﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HCMServices.DAO;
using HCMServices.DTO;
using System.Collections.Generic;

namespace HCMServices.Tests.TESTDAO
{
    /// <summary>
    /// Unit test for KeyStreetDAO class
    /// </summary>
    [TestClass]
    public class TestKeyStreetDAO
    {
        /// <summary>
        /// Unit test for Search() method in KeyStreetDAO class
        /// </summary>
        [TestMethod]
        public void TestSearch()
        {
            string connectString = "Data Source = isostore:/Database.sdf";

            KeyStreetDAO keyStreetDao = new KeyStreetDAO(connectString);
            List<KeyStreetDTO> listKeyStreetDTO = null;
            listKeyStreetDTO = keyStreetDao.Search("nguyen hue");
            if (listKeyStreetDTO != null && listKeyStreetDTO.Count > 0 && listKeyStreetDTO[0].StreetId == 1108 && listKeyStreetDTO[0].KeyStreetId == 1529 && listKeyStreetDTO[0].KeyStreet == "nguyen hue")
            {
                Assert.IsTrue(true);
                return;
            }

            Assert.IsFalse(true);
        }
    }
}
